/**
 * File: GenericDataHolder.java
 * Created by: mhaimel
 * Created on: Apr 19, 2010
 * CVS:  $Id: GenericDataHolder.java 1.0 Apr 19, 2010 9:42:42 AM mhaimel Exp $
 */
package uk.ac.ebi.curtain.utils.data.impl;

import java.util.Arrays;

import uk.ac.ebi.curtain.utils.data.DataEntry;
import uk.ac.ebi.curtain.utils.data.MetaData;

/**
 * @author mhaimel
 *
 */
public class GenericDataHolder<T> implements DataEntry<T> {
	
	private final MetaData meta;
	private final T[] entries;

	public GenericDataHolder(MetaData meta, T ... entries) {
		this.meta = meta;
		this.entries = entries;
	}

	@Override
	public T[] getEntries() {
		return entries;
	}

	@Override
	public MetaData getMetaData() {
		return this.meta;
	}
	
	@Override
	public String toString() {
		return new StringBuilder()
			.append(getMetaData())
			.append(": ")
			.append(
					Arrays.toString(getEntries()))
			.toString();
	}
	
}
